/*
 * AI 专区 EditFields 注册表
 * 目标：集中 AI 组件的属性面板配置，避免与内置配置文件冲突。
 */
import { Field } from '../types';
import { DATE_FORMAT_WITH_TIME } from '@/constants/constants';

const editFields: Record<string, Field[]> = {
  UsageTrendsProd2: [
    // ========== HEADER ==========
    {
      key: 'visible',
      name: 'Visibility',
      type: 'Checkbox',
      belongTo: 'header',
    },

    // ========== CONTENT TAB ==========

    // Event Report Setting - uses default renderEventReportSetting (floorName field)
    {
      key: 'floorName',
      name: 'Component Instance Name',
      type: 'Input',
      belongTo: 'eventReportSetting',
    },

    // Quick Template
    {
      key: 'quickTemplate',
      name: 'Quick Template',
      type: 'Radio',
      options: [
        { label: 'White Theme', value: 'white' },
        { label: 'Purple Theme', value: 'purple' },
      ],
      belongTo: 'dashboardThemeTypeMuti',
    },

    // Basic Info - delegated to renderBasicInfo/renderUsageTrendsProd2.tsx
    {
      key: 'slot',
      name: 'Title & More Configuration',
      type: 'Space',
      belongTo: 'basicInfo',
    },

    // Visibility Rules
    {
      key: 'slot',
      name: 'Visibility Rules',
      type: 'Space',
      belongTo: 'groupSetting',
    },

    // Effective Setting
    {
      key: 'publishTime',
      name: 'Effective Date',
      type: 'DatePicker',
      format: DATE_FORMAT_WITH_TIME,
      showTime: true,
      belongTo: 'publishInfo',
    },
    {
      key: 'expireTime',
      name: 'Expiration Date',
      type: 'DatePicker',
      format: DATE_FORMAT_WITH_TIME,
      showTime: true,
      belongTo: 'publishInfo',
    },

    // ========== STYLE TAB ==========

    // Title Style - delegated to renderTitleStyle/UsageTrendsProd2.tsx
    {
      key: 'slot',
      name: 'Title Style',
      type: 'Space',
      belongTo: 'titleStyle',
    },

    // Chart Style - delegated to renderCardStyle/UsageTrendsProd2.tsx
    {
      key: 'slot',
      name: 'Chart Style',
      type: 'Space',
      belongTo: 'cardStyle',
    },

    // Component Style
    {
      key: 'slot',
      name: 'Component Style',
      type: 'Space',
      belongTo: 'componentStyle',
    },
  ],
};

export default editFields;
